package com.groupbuying.payconsumer.wxpay;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author gxy
 * @Description 微信支付参数配置
 * @Date 2019/2/18 9:39
 **/
@Component
public class WXPayMsgConfig {


    //这个就是自己要保管好的私有Key了（切记只能放在自己的后台代码里，不能放在任何可能被看到源代码的客户端程序中）
    // 每次自己Post数据给API的时候都要用这个key来对所有字段进行签名，生成的签名会放在Sign这个字段，API收到Post数据的时候也会用同样的签名算法对Post过来的数据进行签名和验证
    // 收到API的返回的时候也要用这个key来对返回的数据算下签名，跟API的Sign数据进行比较，如果值不一致，有可能数据被第三方给篡改
    //6ad668cb5dda4bdb88480592a2c130d2

    //移动app应用 appId
    public static final String APP_APP_ID ="wxc5fae795db60bc2d";
    //移动app应用 对应商户id
    public static final String APP_MCH_ID ="1488492522";//"1445326702";

//    public static final String KEY = "NTRmFWC6M5HYv5DPzmheIaBi5BPFs4eF";//"a1234567891011121314151617181920";
    public static final String KEY = "JmJHxHMKkAqKlYlZEAaSSKdV23PXohH4";//"a1234567891011121314151617181920";
    //微信分配的公众号ID（开通公众号之后可以获取到）
    public static final String APP_ID ="wxc9e182b6a92d4dea";//"wxe2a7530bfa71b9e4"; //"wxc5fae795db60bc2d "    ;
    //微信支付分配的商户号ID（开通公众号的微信支付功能之后可以获取到）
    public static final String MCH_ID ="1532025201";//"1500662691";//"1488492522";
    //小程序APP_ID
    public static final String SMALL_APP_ID ="wxaca5667a8ee579ec";//"wxe2a7530bfa71b9e4"; //"wxc5fae795db60bc2d "    ;
    /**
     * 字符集编码 默认UTF-8
     */
    public static final String charset ="UTF-8";
    //HTTPS证书的本地路径
    public static final String CERT_LOCAL_PATH ="key/apiclient_cert.p12"; //"key/weapp_cert.p12";

    public static final String APP_CERT_LOCAL_PATH ="appkey/apiclient_cert.p12"; //"key/weapp_cert.p12";

    //HTTPS证书密码，默认密码等于商户号MCHID
    public static final String CERT_PASSWORD ="1500662691";// "1445326702";
    public static final String APP_CERT_PASSWORD ="1488492522";// "1445326702";

    // 回调地址
//    public static final String NOTIFY_URL ="http://shop.qwang.com.cn/weixinpay/weAppNotify";//"http://shop.qwang.com.cn/weixinpay/weAppNotify";
//    public static  String NOTIFY_URL ;
////    @Value("${weChatNotifyUrl}")
////    public void setNotifyUrl(String NOTIFY_URL){
////        WXPayMsgConfig.NOTIFY_URL = NOTIFY_URL;
////    }
    //1）统一支付API
    public static final String PAY_API_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder";

    //2）支付查询API
    public static final String ORDER_QUERY_API = "https://api.mch.weixin.qq.com/pay/orderquery";

    //3）退款API
    public static final String REFUND_API = "https://api.mch.weixin.qq.com/secapi/pay/refund";

    //4）退款查询API
    public static final String REFUND_QUERY_API = "https://api.mch.weixin.qq.com/pay/refundquery";

    //5）撤销API
    public static final String REVERSE_API = "https://api.mch.weixin.qq.com/secapi/pay/reverse";

    //6）下载对账单API
    public static final String DOWNLOAD_BILL_API = "https://api.mch.weixin.qq.com/pay/downloadbill";

    //7) 统计上报API
    public static final String REPORT_API = "https://api.mch.weixin.qq.com/payitil/report";
    //8) 代付
    public static final String TRANSFERS_API = "https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers";
    //8) 取消交易
    public static final String CLOSE_API = "https://api.mch.weixin.qq.com/pay/closeorder";

    /**
     * 签名方式
     */
    public static final String SIGN_TYPE = "MD5";
    /**
     * App支付
     */
    public static final String TRADE_TYPE_APP = "APP";

    /**
     * 原生扫码支付
     */
    public static final String TRADE_TYPE_NATIVE = "NATIVE";
    /**
     * wap 支付
     */
    public static final String TRADE_TYPE_H5 = "MWEB";
    /**
     * H5 公众号支付和小程序支付
     */
    public static final String TRADE_TYPE_JSAPI = "JSAPI";



}